* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
#app {
  background-color: #2c3e50;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}
.container {
  width: 1000px;
  height: 1000px;
  display: flex;
  flex-wrap: wrap;
  align-content: center;

  transform-style: preserve-3d;
  transform: rotateX(60deg) rotateZ(30deg);
}
.boxContainer {
  width: 30%;
  height: 30%;
  position: relative;
}
.box {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 250px;
  height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: 0.3s;
  z-index: 100;
  transform-style: preserve-3d; //这里好奇怪,去掉这条,会导致box hover时,前面和右面消失
}
.box::before {
  content: "";
  width: 100%;
  height: 20px;
  position: absolute;
  bottom: 0;
  left: 0;
  background-color: #c0392b;
  transform-origin: bottom;
  transform: rotateX(90deg);
  transition: 0.3s;
}
.box::after {
  content: "";
  width: 20px;
  height: 100%;
  position: absolute;
  bottom: 0;
  right: 0;
  background-color: #c0392b;
  transform-origin: right;
  transform: rotateY(-90deg);
  transition: 0.3s;
}
.boxContainer:hover {
  .box {
    transform: translateZ(60px);
  }
  .box::before {
    height: 80px;
  }
  .box::after {
    width: 80px;
  }
}
.color {
  text-align: center;
  height: 40px;
  line-height: 40px;
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
}
